package com.yml;

import com.yml.bean.Spring;
import org.yaml.snakeyaml.Yaml;

import java.util.Map;

/**
 * @author zhangjg
 * @desc t
 * @date 2023/04/14 10:18
 **/
public class Test {

    public static void main(String[] args) {
        YmlUtil ymlUtil = new YmlUtil();
//        System.out.println(ymlUtil.getString());
//        YmlUtil ymlUtil2 = ymlUtil.prefix("rocketmq");
//        System.out.println(ymlUtil2.getString());

        try {
            Yaml yaml = new Yaml();
//            yaml.loadAs("",Topic.class);

//            Yaml yaml = new Yaml();
//            String ste = yaml.dump(t);
//            System.out.println(ste);

//            Spring s = ymlUtil.loadFile("application-mysql.yml", Spring.class );
//            s.getDatasource().getDruid().setPassword("password");
            YmlUtil prefix = ymlUtil.prefix("spring.datasource.druid");
            Map map = prefix.getMap();

        } catch (Exception e) {
            e.printStackTrace();
        }


    }
}
